package com.michaelbulava.TFS.tasks;

import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;

/**
 * Created by mbulava on 6/10/2015.
 */
public abstract class BackgroundableTask extends Task.Backgroundable {

    protected BackgroundableTask(Project project, String title, boolean canBeCancelled) {
        super(project, title, canBeCancelled, null);
    }

    @Override
    public final boolean shouldStartInBackground() {
        return runInBackground();
    }

    @Override
    public final boolean isConditionalModal() {
        return true;
    }
//    protected BackgroundableTask(Project project, String title, boolean canBeCancelled, PerformInBackgroundOption backgroundOption) {
//        super(project, title, canBeCancelled, backgroundOption);
//    }

    protected abstract boolean runInBackground();



}
